import unittest
from  HTMLTestRunner import HTMLTestRunner
# loa = unittest.TestLoader().discover('./','myt*.py')
loa = unittest.TestLoader().discover('./','mt*.py')
#二进制写，不需要用encoding='utf8'

# f = open(r'./a.txt','w',encoding='utf8')
# r = unittest.TextTestRunner(stream=f,verbosity=2)
f = open(r'./a1.html','wb')
r = HTMLTestRunner(stream=f,title='测试报告')
r.run(loa)
f.close()
